package com.cloudkinto.dto.stock;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class StockCheckProductDetailDto {
    private Long id;

    @ApiModelProperty("产品")
    private Long productId;

    @ApiModelProperty("库位id")
    private Long rackId;
    private String sku;
    private String productName;
    @ApiModelProperty("库位")
    private String cellNo;
    @ApiModelProperty("库区类型 拣货区 残次品取")
    private Integer areaType;
    @ApiModelProperty("库区类型 0正品 1次品")
    private Integer mainType;
    @ApiModelProperty("company_id")
    private Long companyId;

    private String companyName;

    private String companyCode;


    private String childTips;

    @ApiModelProperty("账面库存")
    private Integer bookStock;

    @ApiModelProperty("实盘库存 只有盘点中编辑才可以")
    private Integer solidStock;

    public String getSkuSimple() {
        if (sku == null) return null;
        if (sku.length() > 15) {
            sku = sku.substring(0, 13);
            sku += "...";
        }
        return sku;
    }

    public String getProductName() {
        if (productName == null) return null;
        if (productName.length() > 12) {
            productName = productName.substring(0, 10);
            productName += "...";
        }
        return productName;    }
}
